import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 三级装柜分页查询
 * @param {查询条件} data
 */
export function pageProdThreePack(query) {
  return request({
    url: 'ProdManage/ProdThreePack/pageList',
    method: 'get',
    params: query,
  })
}

/**
 * 新增三级装柜
 * @param data
 */
export function addProdThreePack(data) {
  return request({
    url: 'ProdManage/ProdThreePack',
    method: 'post',
    data: data,
  })
}
/**
 * 修改三级装柜
 * @param data
 */
export function updateProdThreePack(data) {
  return request({
    url: 'ProdManage/ProdThreePack',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取三级装柜详情
 * @param {Id}
 */
export function getProdThreePack(id) {
  return request({
    url: 'ProdManage/ProdThreePack/' + id,
    method: 'get'
  })
}

/**
 * 删除三级装柜
 * @param {主键} pid
 */
export function delProdThreePack(pid) {
  return request({
    url: 'ProdManage/ProdThreePack/delete',
    method: 'POST',
    data: pid
  })
}
// 导出三级装柜
export async function exportProdThreePack(query) {
  await downFile('ProdManage/ProdThreePack/export', { ...query })
}
